/*
 * author : Dinh Ngoc Tuan Vu (A0092633)
 */

package sg.edu.nus.iss.team4ft.service;

import java.io.Serializable;

public class Address implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String addressLine1 = "";
	private String addressLine2 = "";
	private String city = "";
	private String country = "";
	private Integer postalCode;
	
	public Address(String addressLine1,String addressLine2, String city, String country, Integer postalCode ){
		setAddressLine1(addressLine1);
		setAddressLine2(addressLine2);
		setCity(city);
		setCountry(country);
		setPostalCode(postalCode);
	}
	
	public String getAddressLine1() {
		return addressLine1;
	}
	
	public void setAddressLine1(String addressLine1) {
		this.addressLine1 = addressLine1;
	}
	
	public String getAddressLine2() {
		return addressLine2;
	}
	
	public void setAddressLine2(String addressLine2) {
		this.addressLine2 = addressLine2;
	}
	
	public String getCity() {
		return city;
	}
	
	public void setCity(String city) {
		this.city = city;
	}
	
	public String getCountry() {
		return country;
	}
	
	public void setCountry(String country) {
		this.country = country;
	}
	
	public Integer getPostalCode() {
		return postalCode;
	}
	
	public void setPostalCode(Integer postalCode) {
		this.postalCode = postalCode;
	}
	
	public boolean equals(Address address){
		if (this.addressLine1.equals(address.addressLine1) && this.addressLine2.equals(address.addressLine2)
				&& this.city.equals(address.city) && this.country.equals(address.country)
				&& this.postalCode.equals(address.postalCode)){
			return true;
		}else{
			return false;
		}
	}
	@Override
	protected Address clone() throws CloneNotSupportedException {
		Address a = new Address(this.addressLine1, this.addressLine2, this.city, this.country, this.postalCode);
		return a;
	}
	
	@Override
	public String toString() {
		return this.addressLine1 + "\n" + 
				this.addressLine2 + "\n" +
				this.city + "\n" +
				this.country + "\n" +
				this.postalCode;
		
	}
}
